#!/usr/bin/env python3

# -*- coding: utf-8 -*-

# @author: zhangbo

# @time: 2025/4/17 16:36

from utils.read_yaml import Read_yaml
from utils.tools import get_project_name, sep


class FenceAlarmNoExitBase:

    def __init__(self, yaml_path):
        # 获取yaml配置
        self.login_config = Read_yaml(yaml_path).get_config_data("fenceAlarmNoExit_config")

    def alarm_center(self):
        """
        报警中心
        :return:
        """
        return self.login_config["fenceAlarmNoExit_config"]["alarmCenter"]

    def alarm_rules(self):
        """
        报警规则
        :return:
        """
        return self.login_config["fenceAlarmNoExit_config"]["alarmRules"]

    def fence_alarm(self):
        """
        围栏报警
        :return:
        """
        return self.login_config["fenceAlarmNoExit_config"]["fenceAlarm"]

    def add(self):
        """
        新增
        :return:
        """
        return self.login_config["fenceAlarmNoExit_config"]["add"]

    def no_exit(self):
        """
        禁止驶入
        :return:
        """
        return self.login_config["fenceAlarmNoExit_config"]["noExit"]

    def enable(self):
        """
        点击启用
        :return:
        """
        return self.login_config["fenceAlarmNoExit_config"]["enable"]

    def alarm_name(self):
        """
        报警名称
        :return:
        """
        return self.login_config["fenceAlarmNoExit_config"]["alarmName"]

    def region_name(self):
        """
        区域名称定位值
        :return:
        """
        return self.login_config["fenceAlarmNoExit_config"]["regionName"]

    def region_name_mess(self):
        """
        区域名称
        :return:
        """
        return self.login_config["region_name"]

    def region_name_find(self):
        """
        区域名称查找
        :return:
        """
        return self.login_config["fenceAlarmNoExit_config"]["region_name_find"]

    def add_car(self):
        """
        自定义车辆
        :return:
        """
        return self.login_config["fenceAlarmNoExit_config"]["add_car"]

    def find_car(self):
        """
        查找对应车辆
        :return:
        """
        return (self.login_config["fenceAlarmNoExit_config"]["send_car_mess"],
                self.login_config["fenceAlarmNoExit_config"]["find_car"])

    def car_id(self):
        """
        车牌号
        :return:
        """

        return self.login_config["dev"]["car_id"]

    def car_select(self):
        """
        勾选对应车辆
        :return:
        """
        return self.login_config["fenceAlarmNoExit_config"]["car_select"]

    def join_car(self):
        """
        车辆加入
        :return:
        """
        return self.login_config["fenceAlarmNoExit_config"]["join_car"]

    def car_save(self):
        """
        车辆保存
        :return:
        """
        return self.login_config["fenceAlarmNoExit_config"]["car_save"]

    def save_button(self):
        """
        报警规则保存
        :return:
        """
        return self.login_config["fenceAlarmNoExit_config"]["saveButton"]

    def get_simulator_conf_parameters(self):
        """
        获取模拟器 simulator_conf 配置文件参数
        :return:
        """

        # 获取phone
        phone = self.login_config["dev"]["phone"]
        terminalNum = self.login_config["dev"]["terminalNum"]
        serverIP = self.login_config["env"]["serverIP"]
        serverPort = self.login_config["env"]["serverPort"]
        fullGps = self.login_config["env"]["fullGps"]
        conf_path = self.login_config["filepath"]["conf_path"]
        gps_info = self.login_config["filepath"]["gps_info"]

        return phone, terminalNum, serverIP, serverPort, fullGps, conf_path, gps_info

    def get_exe_path(self):
        """
        获取exe_path 路径地址
        :return:
        """

        return self.login_config["filepath"]["exe_path"]

    def get_alarm_center(self):
        """
        报警台账
        :return:
        """
        return self.login_config["fenceAlarmNoExit_config"]["alarmLedger"]

    def get_alarm_ledger_clear_button(self):
        """
        报警条件清除
        :return:
        """
        return self.login_config["fenceAlarmNoExit_config"]["alarmLedgerClearButton"]

    def get_alarm_type(self):
        """
        选择报警类型
        :return:
        """
        return self.login_config["fenceAlarmNoExit_config"]["alarmType"]

    def get_choose_over_thermal(self):
        """
        选择超温告警
        :return:
        """
        return self.login_config["fenceAlarmNoExit_config"]["alarmTypeNoEntry"]

    def get_car_num_input(self):
        """
        点击车牌号控件
        :return:
        """
        return self.login_config["fenceAlarmNoExit_config"]["car_num_input"], \
        self.login_config["fenceAlarmNoExit_config"][
            "car_num"]

    def get_start_end_time(self):
        """
        报警开始结束时间
        :return:
        """
        return self.login_config["fenceAlarmNoExit_config"]["start_input_time"], \
        self.login_config["fenceAlarmNoExit_config"][
            "end_input_time"]

    def query_button(self):
        """
        查询按钮
        :return:
        """
        return self.login_config["fenceAlarmNoExit_config"]["query_button"]

    def result_element_tr(self):
        """
        报警上报条件
        :return:
        """
        return self.login_config["fenceAlarmNoExit_config"]["alarm_result"]
